var adClassList;
var localData =[
    {"id": 1,"adClassName": "shaofancun","illustrate":"邵钒淳"},
    {"id": 2,"adClassName": "asfas","illustrate":"邵钒淳"},
    {"id": 3,"adClassName": "bbbb","illustrate":"邵钒淳"},
    {"id": 4,"adClassName": "www","illustrate":"邵钒淳"}
    ];
$(function () {
    if($("#adClassList").length>0){
        adClassList = $.fn.bsgrid.init('adClassList', {
            localData: localData,   //本地json
            //url:'',               //数据地址
            // autoLoad: false,
            pageSizeSelect: true,
            pageSize: 10,
            stripeRows: true
        });
    }
    
});
var adClass={
    //表格操作
    operate:function(record, rowIndex, colIndex, options) {
        var id=adClassList.getRecordIndexValue(record, 'id')
        var operate='';
        operate+='<a href="adClassEdit.html?id=' + id + '">编辑</a> <a href="javascript:;" onclick="adClass.del(' + id + ')">删除</a>';
        return operate;
    },
    del:function(id){
        table.del({
            "id":id,
            "url":'../../testApi/dels.php'
        })
    }
}

$("#adclassAdd").validate({
	rules:{
		adClassName:{required:true}
	}
})
$("#adclassEdit").validate({
	rules:{
		adClassName:{required:true}
	}
})